import sys
import os
# from bigScreenDigitalPeople.portToPort import myspider_ctlScreen, myspider_ananysis, myspider_chart
# from bigScreenDigitalPeople.bigScreen import control_screen,chit_chat,data_analysize,data_analysis_single


def main(testType, testKind):
    if testType == "portToPort":
        if testKind == "ctlScreen":
            os.system("scrapy runspider ./portToPort/myspider_ctlScreen.py")
        elif testKind == "chitChat":
            os.system("scrapy runspider ./portToPort/myspider_chit.py")
        elif testKind == "dataAnalysis":
            os.system("scrapy runspider ./portToPort/myspider_ananysis.py")
    elif testType == "interFace":
        pass


if __name__ == '__main__':

    if len(sys.argv) in [1,2]:
        print("请输入本次的:\n"
              "测试类型：  portToPort   or   interFace\n"
              "用例类型：  ctlScreen or chitChat or dataAnalysis")
    elif len(sys.argv) == 3:
        testType = sys.argv[1]
        testKind = sys.argv[2]
        if testType not in ['portToPort','interFace'] or testKind not in ['ctlScreen','chitChat','dataAnalysis']:
            print("请输入本次的:\n"
                  "测试类型：  portToPort   or   interFace\n"
                  "用例类型：  ctlScreen or chitChat or dataAnalysis")
        else:
            main(testType, testKind)
    else:
        print("请输入正确的测试类型（portToPort or interFace）和测试方向（ctlScreen or chitChat or dataAnalysis）")
